import 'package:flutter/cupertino.dart';
import 'package:imember/Util/Global.dart';
import 'package:imember/Util/MyColor.dart';
import 'package:imember/Util/PageUtil.dart';
import 'package:imember/Widget/MyButton.dart';
import 'package:imember/Widget/MyDialog.dart';
import 'package:imember/Widget/MyImage.dart';
import 'package:imember/Widget/MyInput.dart';

class TripDetail extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _TripDetail();
  }
}

class _TripDetail extends State {
  @override
  Widget build(BuildContext context) {
    return Container(
        width: 600,
        color: MyColor.White,
        child: Column(mainAxisSize: MainAxisSize.min, children: [
          Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
            LocalImage("ic_back_g.png", width: 48, onTap: () {
              PageUtil().back(context);
            }),
            Text("行程資訊", style: TextStyle(fontSize: 20, color: MyColor.C51)),
            Container(width: 48)
          ]),
          Container(color: MyColor.C4, height: 1),
          Info("訂單編號　", "旅行社"),
          Info("送貨方式　", "自取"),
          Info("到達日期　", "2020/12/22 "),
          Info("到達時間　", "14:56"),
          Info("車號　　　", "AUQ-5583"),
          Info("車型　　　", "遊覽車"),
          Info("人數　　　", "123"),
          Info("出發地　　", "金門機場"),
          Info("回程日期　", "2020/12/22 "),
          Info("班機/船班\n時間　　　", "14:56"),
          Container(height: 24)
        ]));
  }
}

class Info extends StatelessWidget {
  String title;
  String value;

  Info(this.title, this.value);

  @override
  Widget build(BuildContext context) {
    return Container(
        padding: EdgeInsets.fromLTRB(0, 10, 0, 10),
        child: Row(children: [
          Container(width: 12),
          Text(title, style: TextStyle(fontSize: 20, color: MyColor.C51)),
          Expanded(
              child: Container(
                  height: 37,
                  alignment: Alignment.centerLeft,
                  margin: EdgeInsets.only(left: 12, right: 24),
                  padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
                  decoration: Global.getBoxBg(20, MyColor.F5),
                  child: Text(value, style: TextStyle(fontSize: 17, color: MyColor.C51))))
        ]));
  }
}

class box extends StatelessWidget {
  String title;
  String content;

  box(this.title, this.content);

  @override
  Widget build(BuildContext context) {
    return Container(
        color: MyColor.F5,
        margin: EdgeInsets.only(top: 13, left: 60),
        padding: EdgeInsets.all(20),
        width: double.infinity,
        child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
          Text(title, style: TextStyle(fontSize: 15, color: MyColor.Orange)),
          Container(height: 12),
          Text(content, style: TextStyle(fontSize: 17, color: MyColor.C51)),
        ]));
  }
}
